

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>5.13. XYZ trajectory reader — MDAnalysis.coordinates.XYZ &mdash; MDAnalysis v0.7.5-devel documentation</title>
    <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '0.7.5-devel',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within MDAnalysis v0.7.5-devel documentation"
          href="../../_static/opensearch.xml"/>
    <link rel="shortcut icon" href="../../_static/mdanalysis-logo.ico"/>
    <link rel="top" title="MDAnalysis v0.7.5-devel documentation" href="../../index.html" />
    <link rel="up" title="5. Coordinates modules" href="../coordinates_modules.html" />
    <link rel="next" title="5.14. The Gromacs xtc/trr library libxdrfile" href="libxdrfile.html" />
    <link rel="prev" title="5.12. Gromacs XTC file IO — MDAnalysis.coordinates.XTC" href="XTC.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="libxdrfile.html" title="5.14. The Gromacs xtc/trr library libxdrfile"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="XTC.html" title="5.12. Gromacs XTC file IO — MDAnalysis.coordinates.XTC"
             accesskey="P">previous</a> |</li>
        <li><a href="../../index.html">MDAnalysis v0.7.5-devel documentation</a> &raquo;</li>
          <li><a href="../coordinates_modules.html" accesskey="U">5. Coordinates modules</a> &raquo;</li> 
      </ul>
    </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/mdanalysis-logo-200x150.png" alt="Logo"/>
            </a></p>
  <h4>Previous topic</h4>
  <p class="topless"><a href="XTC.html"
                        title="previous chapter">5.12. Gromacs XTC file IO &#8212; <tt class="docutils literal docutils literal docutils literal"><span class="pre">MDAnalysis.coordinates.XTC</span></tt></a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="libxdrfile.html"
                        title="next chapter">5.14. The Gromacs xtc/trr library <tt class="docutils literal"><span class="pre">libxdrfile</span></tt></a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../../_sources/documentation_pages/coordinates/XYZ.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" size="18" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <span class="target" id="module-MDAnalysis.coordinates.XYZ"></span><div class="section" id="xyz-trajectory-reader-mdanalysis-coordinates-xyz">
<h1>5.13. XYZ trajectory reader &#8212; <a class="reference internal" href="#module-MDAnalysis.coordinates.XYZ" title="MDAnalysis.coordinates.XYZ"><tt class="xref py py-mod docutils literal"><span class="pre">MDAnalysis.coordinates.XYZ</span></tt></a><a class="headerlink" href="#xyz-trajectory-reader-mdanalysis-coordinates-xyz" title="Permalink to this headline">¶</a></h1>
<p>Resources: the XYZ format was taken from
<a class="reference external" href="http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/xyzplugin.html">http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/xyzplugin.html</a> and
is therefore compatible with VMD (you need a PDB or PSF file to define
the topology, just as here)</p>
<ul class="simple">
<li>comments are not allowed in the XYZ file</li>
<li>the atom name (first column) is ignored</li>
<li>the coordinates are assumed to be space-delimited rather than fixed width (this may cause issues - see below)</li>
<li>all fields to the right of the z-coordinate are ignored</li>
<li>it is assumed that the number following &#8220;frame&#8221; is the time in picoseconds</li>
<li>it is assumed that the coordinates are in Angstroms</li>
<li>the unitcell information is all zeros since this is not recorded in the XYZ format</li>
</ul>
<p>There appears to be no rigid format definition so it is likely users
will need to tweak this Class.</p>
<dl class="class">
<dt id="MDAnalysis.coordinates.XYZ.XYZReader">
<em class="property">class </em><tt class="descclassname">MDAnalysis.coordinates.XYZ.</tt><tt class="descname">XYZReader</tt><big>(</big><em>xyzfilename</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#MDAnalysis.coordinates.XYZ.XYZReader" title="Permalink to this definition">¶</a></dt>
<dd><p>Reads from an XYZ file</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Data :</th><td class="field-body"><dl class="first docutils">
<dt>ts</dt>
<dd><p class="first last">Timestep object containing coordinates of current frame</p>
</dd>
</dl>
</td>
</tr>
<tr class="field"><th class="field-name">Methods :</th><td class="field-body"><dl class="first last docutils">
<dt><tt class="docutils literal"><span class="pre">len(xyz)</span></tt></dt>
<dd><p class="first last">return number of frames in xyz</p>
</dd>
<dt><tt class="docutils literal"><span class="pre">for</span> <span class="pre">ts</span> <span class="pre">in</span> <span class="pre">xyz:</span></tt></dt>
<dd><p class="first last">iterate through trajectory</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p>File format: <a class="reference external" href="http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/xyzplugin.html">http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/xyzplugin.html</a></p>
<p>Validation: the geometric centre of 1284 atoms was calculated over
500 frames using both MDAnalysis and a VMD Tcl script. There was
exact agreement (measured to 3DP). bzipped and gzipped versions of
the XYZ file were also tested</p>
<dl class="method">
<dt id="MDAnalysis.coordinates.XYZ.XYZReader.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#MDAnalysis.coordinates.XYZ.XYZReader.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Close xyz trajectory file if it was open.</p>
</dd></dl>

<dl class="attribute">
<dt id="MDAnalysis.coordinates.XYZ.XYZReader.numatoms">
<tt class="descname">numatoms</tt><a class="headerlink" href="#MDAnalysis.coordinates.XYZ.XYZReader.numatoms" title="Permalink to this definition">¶</a></dt>
<dd><p>number of atoms in a frame</p>
</dd></dl>

<dl class="method">
<dt id="MDAnalysis.coordinates.XYZ.XYZReader.rewind">
<tt class="descname">rewind</tt><big>(</big><big>)</big><a class="headerlink" href="#MDAnalysis.coordinates.XYZ.XYZReader.rewind" title="Permalink to this definition">¶</a></dt>
<dd><p>reposition on first frame</p>
</dd></dl>

</dd></dl>

</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="libxdrfile.html" title="5.14. The Gromacs xtc/trr library libxdrfile"
             >next</a> |</li>
        <li class="right" >
          <a href="XTC.html" title="5.12. Gromacs XTC file IO — MDAnalysis.coordinates.XTC"
             >previous</a> |</li>
        <li><a href="../../index.html">MDAnalysis v0.7.5-devel documentation</a> &raquo;</li>
          <li><a href="../coordinates_modules.html" >5. Coordinates modules</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2005-2011, Naveen Michaud-Agrawal, Elizabeth J. Denning, Joshua Adelman,
    Christian Beckstein (logo), David Caplan, Jan Domański, Philip Fowler,
    Joseph Goose, Benjamin Hall, Danny Parton, Tyler Reddy, Paul Rigor,
    and Oliver Beckstein.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
    </div>
  </body>
</html>